<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>人工保洁未完成报警</title>
  <script src="https://cdn.staticfile.org/vue/2.7.0/vue.min.js"></script>
  <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
  <script src="https://unpkg.com/element-ui@2.15.13/lib/index.js"></script>

  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <link type="text/css" rel="stylesheet" href="https://unpkg.com/element-ui@2.15.13/lib/theme-chalk/index.css" />
</head>

<body>
  <div id="app">
    <el-table :data="tableData" border style="width: 100%">
      <!-- 道路名称	作业状态	标准次数	作业次数	作业人员 -->
      <el-table-column prop="道路名称" label="道路名称" align="center" width="180">
      </el-table-column>
      <el-table-column prop="作业状态" label="作业状态" align="center" width="180">
      </el-table-column>
      <el-table-column prop="标准次数" align="center" label="标准次数">
      </el-table-column>
      <el-table-column prop="作业次数" align="center" label="作业次数">
      </el-table-column>
      <el-table-column prop="作业人员" align="center" label="作业人员">
      </el-table-column>
    </el-table>
  </div>

  <script>
    new Vue({
      el: '#app',
      data: {
        message: 'Hello Vue.js!',
        tableData: []
      },
      created () {
        this.getRestaurantInfo(this.GetQueryValue("date"), this.GetQueryValue("clientNo"))
        // var intVID = this.$route.query.VID
        // var queryArr = window.location.href.split('#')
        // // console.log(queryArr)
        // if (queryArr.length > 2) {
        //   this.getRestaurantInfo(queryArr[1], queryArr[2])
        // }else{
        //   this.getRestaurantInfo('2023-05-04', '0000009')
        // }
      },
      methods: {
        getRestaurantInfo (date, clientNo) {
          let url = 'http://111.160.78.62:9929/CompanyapiBDEapi/Vehicle/GetVehicleNoWorkInfo?type=人工&client_no=' + clientNo + '&workdate=' + date
          axios.get(url).then(result => {
            this.tableData = result.data
          })
        },
        GetQueryValue (queryName) {
          var reg = new RegExp("(^|&)" + queryName + "=([^&]*)(&|$)", "i");
          var r = window.location.search.substr(1).match(reg);
          if (r != null) {
            return decodeURI(r[2]);
          } else {
            return null;
          }
        },
      }
    })
  </script>
</body>

</html>